<template>
	<view class="search_head_block">
		<input v-model="param"  class="uni-input search_input  font-hit" placeholder="歌曲名,歌手" />
		<view class="search_text" @click="search()">
			🔍	
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				param:null
			}
		},
		methods: {
			// 跳转搜索页
			search(){
				if (this.param == null || this.param == '') {
					uni.showToast({
						title:'🥀'+"参数不能为空",
						icon:'error',
						duration:2000
					})
				}
				var searchPagePath = "/pages/search/search?param=" + this.param;
				uni.navigateTo({
					url: searchPagePath
				})
			},
			// 修改搜索参数
			setParam(data){
				this.param = data;
			}
		}
	}
</script>

<style>
.search_head_block{
	width: 90%;
	height: 40px;
	text-align: left;
	text-indent: 2em;
	display: flex;
	flex-direction: row;
	align-items: center;
}
.search_input{
	border-radius: 25px;
	border: 1px solid;
	background-color: white;
	border-radius: 25px;
	width: 90%;
	height: 40px;
	text-align: left;
	text-indent: 2em;
	display: flex;
}
.search_text{
	font-size: 24px;
	width: 10%;
	height: 40px;
	display: flex;
	align-items: center;
	margin-left: -25px;
}
</style>
